package com.company.factory.method;

import com.company.factory.method.impl.DazhongFactory;
import com.company.factory.method.impl.TeslaFactory;
import com.company.factory.method.impl.WulingFactory;

public class Consumer {
    public static void main(String[] args) {
//      接口，手动创建
//      Car car1=new WuLin();
//      Car car2=new Tesla();
//      2，使用简单工厂创建
//        Car car1 = CarFactory.getCar("五菱");
//        Car car2 = CarFactory.getCar("特斯拉");
//      3，使用工厂方法创建
        Car car1 = new WulingFactory().getCar();
        Car car2 = new TeslaFactory().getCar();
        Car car3 = new DazhongFactory().getCar();
        car1.name();
        car2.name();
        car3.name();
    }
}
